local ExcelNpc = require("excel.Npc")
local Msg = require("core.Msg")
local Obj = require("core.Obj")

SPECIAL_ACTION_TEAM_COPY = 1 -- 组队副本入口
SPECIAL_ACTION_JUMP = 2		 -- 跳跃机关

function create(npc_id)
	if not npc_id then
		assert(nil, npc_id)
	end
	if not ExcelNpc.npc[npc_id] then
		assert(nil, npc_id)
	end
	local npc = {}
	Obj.create(npc, Obj.TYPE_NPC)
	npc.npc_id = npc_id
	return npc
end

function getConfigName(npc)
	return ExcelNpc.npc[npc.npc_id].name
end

function getObjAdd(npc)
	local mm = Msg.gc.GC_ADD_NPC
	mm.obj_id = npc.id
	mm.x = npc.x
	mm.y = npc.y
	local cf = ExcelNpc.npc[npc.npc_id]
	mm.head_title = cf.head_titleicon_id
	if npc.name then
		mm.name = npc.name
	else
		mm.name = cf.name
	end
	mm.npc_id = npc.npc_id
	mm.body_id = cf.body_id
	mm.body_scale = cf.body_scale
	mm.horse_id = cf.horse
	mm.head_id = cf.head_id
	mm.body_height = cf.body_height
	mm.way = cf.way
	mm.special_action = cf.special_action
	mm.bindTask1 = cf.bindTask1
	mm.bindTask2 = cf.bindTask2
	return mm
end
